<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/jsp/include/taglibs.tag"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>友情链接</title>
<%@ include file="/WEB-INF/jsp/include/backBase.jsp"%>
</head>
<body>
	<div class="modal fade" id="linkInforModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true"></div>
	<div class="modal fade" id="linkAddModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true">
		<!-- 模态框（Modal） -->
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">添加链接</h4>
				</div>
				<div class="modal-body">
					<form action="<%=ctx%>/back/link/addLink.do" method="post">
						<p>链接名称：</p>
						<p>
							<input type="text" name="name" class="form-control" />
						</p>
						<p>链接地址：</p>
						<p>
							<input type="text" name="Url" class="form-control" />
						</p>
						<div class="modal-footer">
							<button type="button" class="btn btn-default"
								data-dismiss="modal">关闭</button>
							<button type="submit" class="btn btn-primary">添加友情链接</button>
						</div>
					</form>
				</div>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>
	<div class="inc">
		<a class="btn btn-sm btn-primary"
			href="javascript:showModal('#linkAddModal')">添加链接</a>
		<!-- <a class="btn btn-sm btn-primary"
			href="javascript:showModal('#linkAddModal')">排序</a> -->
	</div>
	<table class="table table-hover">
		<thead>
			<tr>
				<th>链接名称</th>
				<th>链接地址</th>
				<th>位置</th>
				<th class="channel-option">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${pl.datas}" var="l">
				<tr>
					<td>${l.name }</td>
					<td>${l.url}</td>
					<td>${l.pos }</td>
					<td class="channel-option"><a
						href="javascript:deleteFrame('#del-link','${l.id }');">删除</a>| <a
						href="javascript:ajaxShow('<%=ctx%>/ajax/showLink.do','#linkInforModal','${l.id }')">编辑</a></td>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<jsp:include page="/jsp/pager.jsp">
		<jsp:param value="${pl.total }" name="totalRecord" />
		<jsp:param value="linkInfor.do" name="url" />
	</jsp:include>
	<form style="display: none;" action="<%=ctx%>/back/link/deleteLink.do"
		method="post" id="del-link">
		<input name="id" type="hidden" />
	</form>
</body>
</html>